
m, n = map(int, raw_input().split())
a = map(int, raw_input().split())
nr_seek = 0
lru = []
for i in a: 
	print 'look %d, nr_lru=%d, nr_seek=%d' % (i, len(lru), nr_seek)
	if i in lru: 
		#lru.remove(i)
		#lru.insert(0, i)
		pass
	else: 
		print "seek %d, nr_lru=%d, nr_seek=%d" % (i, len(lru), nr_seek)
		if len(lru)>=m: 
			lru.pop(-1)
		lru.insert(0, i)
		nr_seek+=1

print nr_seek
